<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>操作日志管理</title>
<script type="text/javascript">
	var $grid;
	$(function() {
		$grid = $("#grid").datagrid($.extend(datagridOption, {
			url : "${ctx}/basic/operateLogs/dataGrid",
			columns : [ [ {
				field : 'ck',
				checkbox : true
			}, {
				field : 'operateName',
				title : '操作者姓名',
				width : 80,
				sortable : true
			}, {
				field : 'operateIp',
				title : 'IP',
				width : 100,
				sortable : true
			}, {
				field : 'operateTime',
				title : '操作时间',
				width : 120,
				sortable : true

			}, {
				field : 'executionTime',
				title : '执行时间',
				width : 60,
				sortable : true
			}, {
				field : 'controllerRequestMapping',
				title : 'controllerRequestMapping',
				sortable : true
			}, {
				field : 'methodRequestMapping',
				title : 'methodRequestMapping',
				sortable : true
			}, {
				field : 'shiroRequiresPermissions',
				title : 'shiroRequiresPermissions',
				sortable : true
			}, {
				field : 'requestUrl',
				title : 'requestUrl',
				sortable : true
			} ] ]
		}));
		$grid.datagrid('enableFilter', [ {
			field : 'operateTime',
			type : 'datebox',
			javaType : 'D',
			op : [ 'EQ', 'NEQ', 'GT', 'LT', 'GTE', 'LTE' ]
		}, {
			field : 'executionTime',
			type : 'numberbox',
			javaType : 'L'
		} ]);
		$("#search").click(function() {
			$grid.datagrid('load', $("#tt").form("getData"));
		});
		//导出
		$("#excelExport").click(function() {
			var url = "${ctx}/basic/operateLogs/excelExport?" + $.param($("#grid").datagrid('options').queryParams);
			if ($("#grid").datagrid("options").filterRules) {
				url += "&filterRules=" + JSON.stringify($("#grid").datagrid("options").filterRules);
			}
			window.parent.location.href = url;
		});
	});
</script>
</head>

<body>
	<div data-options="region:'center',fit:true,border:false">
		<table id="grid">
		</table>
		<div id="tt" class="row">
		<div class="col-md-8">
			<shiro:hasPermission name="operateLogs:list">
			<form class="form-grid-search form-inline">
				<div class="form-group">
					<span>操作时间：</span>
					<input type="text" class="easyui-datetimebox" name="search_GT-T_operateTime"  />
					<span>至</span>
					<input type="text" class="easyui-datetimebox" name="search_LT-T_operateTime"  />
				</div>
				<button type="button" id="search" class="btn btn-primary">
					<span class="glyphicon glyphicon-search"></span> 查询
				</button>
			</form>
			</shiro:hasPermission></div>
			<div class="col-md-4">
			<shiro:hasPermission name="operateLogs:export">
				<button id="excelExport" type="button" class="btn btn-primary">
					<span class="glyphicon glyphicon-save"></span> Excel导出
				</button>
			</shiro:hasPermission></div>
		</div>
	</div>
</body>
</html>
